import RequestBase from '@/utils/request.js';
import config from '@/config';

const notificationReq = new RequestBase(config.notificationUrl);
const videoReq = new RequestBase(config.videoUrl);
const positionReq = new RequestBase(config.positionUrl);

// 报警事件列表
export function getWarnEventList(params) {
  return notificationReq.get(`/ntf/alarm-info/list`, params);
}

// 报警事件详情
export function getWarnEventDetail(id) {
  return notificationReq.get(`/ntf/alarm-info/${id}`);
}

// 处理报警事件
export function handleWarnEvent(data) {
  return notificationReq.post(`/ntf/alarm-info/${data.id}/handler`, data);
}

// 查看监控
export function getVideoUrl(id) {
  return videoReq.put(`/monitor-device/${id}/play`);
}

//人员定位
export function reqGetPersonTrack(cardCode, params) {
  return positionReq.get(`/track/person/${cardCode}`, params);
}
